<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改锜风公寓-房间')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-room-edit" th:object="${qifRoom}">
            <input name="roomId" th:field="*{roomId}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">单元号：</label>
                    <div class="col-sm-8">
                        <select name="unit" class="form-control m-b" th:with="type=${@dict.getType('qif_room_unit')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">房间莞e号：</label>
                    <div class="col-sm-8">
                        <input name="roomENum" th:field="*{roomENum}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">房间号：</label>
                    <div class="col-sm-8">
                        <input name="roomNum" th:field="*{roomNum}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">租金(元)：</label>
                    <div class="col-sm-8">
                        <input name="rent" th:field="*{rent}" class="form-control" type="text" >
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label ">押金(元)：</label>
                    <div class="col-sm-8">
                        <input name="deposit" th:field="*{deposit}" class="form-control" type="text" >
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label ">房卡(元)：</label>
                    <div class="col-sm-8">
                        <input name="keyCard" th:field="*{keyCard}" class="form-control" type="text" >
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">水表(方)：</label>
                    <div class="col-sm-8">
                        <input name="water" th:field="*{water}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">水单价(元)：</label>
                    <div class="col-sm-8">
                        <input name="waterUnitPrice" th:field="*{waterUnitPrice}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">电表(度)：</label>
                    <div class="col-sm-8">
                        <input name="electricity" th:field="*{electricity}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">电单价(元)：</label>
                    <div class="col-sm-8">
                        <input name="electricityUnitPrice" th:field="*{electricityUnitPrice}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">卫生费(元)：</label>
                    <div class="col-sm-8">
                        <input name="sanitationFee" th:field="*{sanitationFee}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">房间类型：</label >
                    <div class="col-sm-8">
                        <select name="roomType" class="form-control m-b" th:with="type=${@dict.getType('qif_room_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{roomType}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">房间状态：</label >
                    <div class="col-sm-8">
                        <select name="status" class="form-control m-b" th:with="type=${@dict.getType('qif_room_status')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">入住时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="checkInTime" th:value="${#dates.format(qifRoom.checkInTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">到期时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="expirationTime" th:value="${#dates.format(qifRoom.expirationTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "qif/room";
        $("#form-room-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-room-edit').serialize());
            }
        }

        $("input[name='checkInTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='expirationTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>